import request from '@/utils/request'

const api_name = 'customer'

export default {
    //查询客户所有信息
    supplierList(page,limit,searchObj){
        return request({
            url: `${api_name}/list/${page}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },
    addSupplier(supplier){
        return request({
            url: `${api_name}/add`,
            method: 'post',
            data: supplier
        })
    },
    //检查客户是否已存在
    checkIsNameAndTypeExist(searchObj){
        return request({
            url: `${api_name}/checkIsNameAndTypeExist`,
            method: 'get',
            params: searchObj
        })
    },
    updateSupplier(supplier){
        return request({
            url: `${api_name}/update`,
            method: 'put',
            data: supplier
        })
    },
    deleteById(id){
        return request({
            url: `${api_name}/delete/${id}`,
            method: 'delete',
        })
    },
    deleteBatch(ids){
        return request({
            url: `${api_name}/deleteBatch`,
            method: 'delete',
            data: ids
        })
    },
    batchUpdate(status,ids){
        return request({
            url: `${api_name}/batchSetStatus/${status}`,
            method: 'put',
            data: ids
        })
    },
    exportExcel(searchObj){
        return request({
            url: `${api_name}/exportExcel`,
            method: 'get',
            params: searchObj
        })
    }
}